import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { PersonInfo } from '../person-info';

@Component({
  selector: 'app-index-page',
  templateUrl: './index-page.component.html',
  styleUrls: ['./index-page.component.less']
})
export class IndexPageComponent implements OnInit {

  constructor(private router: Router) { }

  model = new PersonInfo('', '', '', '', '');

  ngOnInit() {
    if (!localStorage.info) {
      this.model.name = '新用户';
    } else {
      this.model.name = JSON.parse(localStorage.getItem('info')).name;
    }
  }

}
